package com.itboye.textileexpes.repository;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;
import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.textileexpes.beans.PayWayBean;
import com.itboye.textileexpes.interfaces.IPayWay;
import com.itboye.textileexpes.json.ByJsonRequest.Builder;
import com.itboye.textileexpres.base.BaseErrorListener;
import com.itboye.textileexpres.base.BaseNetRepository;
import com.itboye.textileexpres.base.BaseSuccessReqListener;

public class PayWayRepository extends BaseNetRepository implements
		IPayWay<PayWayBean> {
	public static final String PAYWAY = "By_Config_supportPayways";

	public PayWayRepository(ICompleteListener listener) {
		// TODO Auto-generated constructor stub
		super(listener);
	}

	@Override
	public void add(PayWayBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(PayWayBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(PayWayBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void getInfo(PayWayBean model) {
		// TODO Auto-generated method stub
		Type type = new TypeToken<List<PayWayBean>>() {
		}.getType();
		String apiVer = "100";
		Map<String, Object> map = new HashMap<String, Object>();

		(new Builder<List<PayWayBean>>())
				.setTypeVerParamsAndReturnClass(PAYWAY, apiVer, map, type)
				.requestListener(
						new BaseSuccessReqListener<List<PayWayBean>>(
								getListener()))
				.errorListener(new BaseErrorListener(getListener()))
				.desEncodeThenBuildAndSend();
	}

	@Override
	public List<PayWayBean> query(PayWayBean model) {
		// TODO Auto-generated method stub
		return null;
	}

}
